package cn.bonoon.kernel.web.resources;

import cn.bonoon.kernel.web.html.AbstractHtmlBuilder;
import cn.bonoon.kernel.web.models.StandardModel;

public class StandardResourceRepository extends AbstractResourceRepository {
	
	public StandardResourceRepository(String name, AbstractHtmlBuilder form) {
		super(name, form.getId(), form.getIncludes(), form.getScript(), form.getBlock());
		putStringResource(form.getHtml());
	}

	public String render(StandardModel model, String id){
		model.addObject(id, this.id);
		
		model.addBlock(block);
		model.addIncludes(includes);
		model.addScript(script);
		return name;
	}
}
